home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970626-19970929
/
000215_news@newsmaster….columbia.edu _Fri Aug 22 11:13:33 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id LAA15412
for <kermit.misc@watsun.cc.columbia.edu>; Fri, 22 Aug 1997 11:13:31 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA05584
for kermit.misc@watsun; Fri, 22 Aug 1997 11:13:24 -0400 (EDT)
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: echo command works differently between 3.14 and 3.15
Date: 22 Aug 1997 15:13:21 GMT
Organization: Columbia University
Lines: 52
Message-ID: <5tkaah$831$1@apakabar.cc.columbia.edu>
References: <33f9b133.266082@news.calvacom.fr> <PYDViO7VXbx1@cc.usu.edu> <KM7xYazirna0@cc.usu.edu>
NNTP-Posting-Host: watsun.cc.columbia.edu
Xref: news.columbia.edu comp.protocols.kermit.misc:7530
In article <KM7xYazirna0@cc.usu.edu>, Joe Doupnik <jrd@cc.usu.edu> wrote:
: Adding what I should have done in the above message: how to work
: around this effect. The solution is to use formal substitution variables,
: \%letter items.
: ...
: The second, variable, format works as desired: a green Yes is
: displayed by both DISP and ECHO command lines. The reason it works is
: because formal substitution variables reevaluate their results recursively,
: thus the parser sees \%g, replaces it by \27[ etc and then reevalutes the
: string from the \ byte again (and hence sees \27 as a \number to be
: reduced to binary).
: Recall, \m(ge) is replaced by the macro ge's definition and that's
: that. The definition is not rescanned for \number conversion.
:
There is method in this madness. Several years of experience with the
scripting language has shown that there is a need for two kinds of variables;
one that is fully (i.e. recursively) evalated, and another that is evaluated
only "one level deep" -- i.e. that is replaced by its literal definition.
Why? Obviously we need a type of variable that is fully evaluated. Example:
define \%n OOFA
define \%t TXT
define \%f \%n.\%t
send \%f
The final command becomes "send OOFA.TXT".
But primarily because of DOS filenames, which use backslash as the directory
separator (great idea!), we also need a type of variable that is evaluated
only once. To illustrate:
define \%f c:\123\x00.txt
echo \%f
does not print "c:\123\x3b.txt". Instead it prints "c:\{;.txt". And so, of
course, "send \%f" doesn't work either.
So for variables whose values are likely to contain literal backslashes,
especially when they are followed by digits or certain other characters
like "x", we use the other form:
define filename c:\123\x00.txt
echo Sending \m(filename)...
send \m(filename)
The problems caused by backslashes in DOS filenames are not limited only
to Kermit, as anybody who has had to write UNIX shell scripts to deal them
can attest. And of course, we get the worst of both worlds when we need to
give a DOS filename to UNIX C-Kermit on the shell command line...
- Frank